package stanowisko;

import org.uncommons.maths.number.NumberGenerator;

import item.Obiekt;

public abstract class StanowiskoImpl<T extends Obiekt> implements Stanowisko<T> {

	private int id;
	double serviceTime;
	Obiekt currentItem;
	double timeLastCarStartedWash;
	protected NumberGenerator<Double> gen;
	
	@Override
	public int dajId() {
		return this.id;
	}
	
	@Override
	public Obiekt dajAktualnyObiekt() {
		return this.currentItem;
	}

	@Override
	public void ustawAktualnyObiekt(Obiekt currentItem) {
		this.currentItem = currentItem;
	}

	@Override
	public double dajCzasObslugi() {
		return this.serviceTime;
	}

	@Override
	public void ustawCzasObslugi(double serviceTime) {
		this.serviceTime = serviceTime;
	}

	@Override
	public double dajCzasRozpoczeciaMyciaSamochodu() {
		return this.timeLastCarStartedWash;
	}

	@Override
	public void ustawCzasRozpoczeciaMyciaSamochodu(double time) {
		this.timeLastCarStartedWash = time;
	}

	@Override
	public boolean czyPusty() {
		if(this.currentItem == null) {
			return true;
		}
		return false;
	}

	@Override
	public void usunObiekt() {
		this.currentItem = null;
	}

}
